/**
 * @description 用户部门管理
 * @author zhu_liangyu
 * @since 2021/12/23
 */

import { OrgServiceApi } from "./_org";
import { AxiosResponse } from "axios"
import service from "/@/utils/request"
import { SYSTEM_CONFIG } from '/@/config/system'


class UnitServiceApi extends OrgServiceApi {
    /**
     * 下载excel附件信息
     * @param templateId 附件模板id
     * @returns 
     */
    downloadExcelTemplate(type: string): Promise<AxiosResponse<Blob>> {
        let url = this.baseUrl + "/downloadTemplate?type=" + type;
        return service.post(url, null, { responseType: 'blob', timeout: SYSTEM_CONFIG.downloadFileTimeout })
    }

    getImportExcelUrl() {
        return this.baseUrl + "/importUnitData"
    }

}
const unitServiceApi = new UnitServiceApi("/UnitService");

export default unitServiceApi;